home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n16.arc / HC.DOC < prev    next >
Text File  |  1991-08-27  |  2KB  |  46 lines

  1. HUGECALC
  2.  
  3.  
  4. Neil Rubenking                                  September 24, 1991 (Utilities)
  5.  
  6.  
  7. Purpose:  A command-line calculator utility that can perform addition, 
  8. subtraction, multiplication, division, exponentiation, and factorial functions 
  9. on numbers with up to 254 significant digits.
  10.  
  11. Format:   HC n operator [n]
  12.  
  13. Remarks:    The n operand variables may consist of any string of digits up to 
  14. the 127-character maximum of the DOS command line.  The operands must not 
  15. include commas or other formatting punctuation, and must be separated from the 
  16. command and the operator by at least one space.  Two operands are required for 
  17. all operations except factorial.  The operators recognized are +, -, *, /, ^, 
  18. and !.
  19.  
  20.         When output to the screen (the default) or redirected to a printer or 
  21. other DOS device, HUGECALC prints the name of the function and inserts commas 
  22. at every three digits in the numeric result.  If the output is redirected to a 
  23. file or piped to a program input, however, only the numeric result is sent.  
  24. Note that when it accepts input from a file or via a pipe, HUGECALC uses that 
  25. input as its first operand.
  26.  
  27. Example:    If a program that prints 10,000 permutations a second is asked to 
  28. print all possible combinations of 13 characters, how long will it take?   The 
  29. command 
  30.  
  31.                 HC 13 ! | HC / 10000 | HC / 3600 | HC / 24
  32.  
  33.         pipes the factorial of 13 (the possible combinations) to a second 
  34. instance of HC, which divides it by 10,000 (the permutations per second). The 
  35. result is piped to a third instance of HC, which divides it by 3600 (the 
  36. seconds in an hour), and finally to a fourth instance of HC, which divides it 
  37. by 24 (the hours in a day).  The answer printed on the screen is:
  38.  
  39.           QUOTIENT: 7
  40.           REMAINDER: 4,
  41.  
  42.           that is, 7 days, 4 hours.
  43.  
  44.         Note that all such chained calculations must be strictly sequential 
  45. and that parenthetical expressions are not supported.
  46.